<!--  -->
<template>
  <div>现病史
 
  <el-checkbox-group @change="handleCheckedChange" v-model="checkList">
    <el-checkbox v-for="item in list" :label="item.name" :value="item.name" />
  </el-checkbox-group>

  </div>
</template>

<script lang='ts' setup>
import { reactive,toRefs,ref,onMounted, inject} from 'vue'
import { getDiseaseList } from '../../apis/elderly/disease';
import { Disease, Elderly } from '../../apis/elderly/type';

const elderly=inject<Elderly>("elderly")!;

const list=ref<Disease[]>([]);

const checkList=ref<string[]>([]);
const getData=async ()=>{
    const res=await getDiseaseList();
    list.value=res.data.list;
}

const handleCheckedChange=()=>{
    elderly.health.nowillness=checkList.value.join(",");

}
getData();
</script>
<style scoped>
</style>